-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wait for writer response on Refresh #333
Conversation
When sending a Refresh message to Writer's refresh channel, if the state is "Succeeded" or "Failed", the Writer will update the sync channel when finished. Therefore there is a need to wait on sync channel on the Daemon side when sending "Succeeded" or "Failed". Signed-off-by: Fred Rolland <[email protected]>
Thanks for your PR,
To skip the vendors CIs use one of:
|
@fedepaol can you PTAL? |
@@ -413,6 +413,8 @@ func (dn *Daemon) nodeStateSyncHandler(generation int64) error { | |||
syncStatus: "Succeeded", | |||
lastSyncError: "", | |||
} | |||
// wait for writer to refresh the status | |||
<-dn.syncCh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC as SyncCh is initialized with a zero capacity. then [1] will block until someone is trying to read from the channel.
nice catch here @rollandf
[1]
syncCh <- struct{}{} |
/test-all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
When sending a Refresh message to Writer's refresh channel,
if the state is "Succeeded" or "Failed", the Writer will update
the sync channel when finished.
Therefore there is a need to wait on sync channel on the Daemon side
when sending "Succeeded" or "Failed".
Signed-off-by: Fred Rolland [email protected]